package com.localShare.prompt;

import android.app.Activity;
import android.app.AlertDialog;
import android.view.View;
import android.widget.Button;

import com.localShare.Common;
import com.localShare.R;

/**
 * Created by 883564
 * on 2016/5/4.
 * 提示类
 */
public class Prompt {
    /**
     * 授权失败提示
     * @param activity 上下文
     */
    public void authorizationFailPrompt(Activity activity){
        //获取提示布局
        View rootView=View.inflate(activity, R.layout.activity_prompt,null);
        //获取提示按钮
        Button yes=(Button)rootView.findViewById(R.id.yes);
        //提示框建立
        final AlertDialog prompt=new AlertDialog.Builder(activity).setView(rootView).create();
        //提示按钮点击事件
        yes.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //销毁提示
                prompt.dismiss();
                //授权失败，调用后续操作
                Common.entryActivity.dealAfterLock(Common.action,Common.intent);
            }
        });
        //提示框显示
        prompt.show();
    }
}
